/*
 * @Author: 吴世扬 18368095041@163.com
 * @Date: 2024-08-22 16:15:54
 * @LastEditors: 吴世扬 18368095041@163.com
 * @LastEditTime: 2024-08-22 17:54:14
 * @FilePath: /vue3-uniapp/src/mock/orderAssign.ts
 */

import type { OrderAssignDetail } from '@/typings/api/orderAssign';

export const readOrderAssignDetail = (
    id?: number
): Promise<MockResponse<HttpResult<OrderAssignDetail>>> => {
    return Promise.resolve({
        data: {
            code: 0,
            msg: `成功`,
            data: {
                id: id || 1,
                description: '这是mock内容'
            }
        }
    });
};

export const orderAssignResponse = (url?: string, param?: unknown) => {
    if (url) {
        const result = url.match(
            /\/mini\/api\/orderAssign\/getOrderAssign\/(\d+)/
        );
        if (result && result.length === 2) {
            return readOrderAssignDetail(+result[1]);
        }
    }
};
